import { View, Text, Button } from 'react-native';
import React from 'react';

export default class Detail extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            mmp: ''
        }
    }

    UNSAFE_componentWillMount = () => {
        this.getData('mmmp')
    }

    getData = async (key) => {
        try {
          const value = await AsyncStorage.getItem(key)
          if(value !== null) {
            // value previously stored
            this.setState({
                mmp: JSON.parse(value)
            })
          }
        } catch(e) {
          // error reading value
        }
    }
    render() {
        return (
            <View>
                <Text>2222</Text>
                <Text>{this.state.mmp}</Text>
                <Button title="go" onPress={this.onPress}></Button>
            </View>
        )
    }
}